Code Duplication    Length = 32-32 lines in 2 locations

public/themes/templates/1/includes/js/news.js 2 locations

@@ 175-206 (lines=32) @@
172
        });
173
    })
174
    // Approve submission Function in dropdown
175
    $('.jsNewsWrapper').on('click', '.jsNewsApproveDropdownItem', function () {
176
        var newsId = $(this).data('news-id');
177
        $('#JSGenericModal').dialog({
178
            title: 'Approve Submission',
179
            open: $('#JSGenericModalText').text('Are you sure you want to approve this submission?'),
180
            resizable: false,
181
            height: 200,
182
            modal: true,
183
            buttons: {
184
                'Approve': function () {
185
                    $(this).dialog('close');
186
                    $.ajaxQueue({
187
                        // The URL for the request
188
                        url: 'db_news.php',
189
                        data: 'action=approve_submission&news_submission_id=' + newsId,
190
                        type: 'POST',
191
                        dataType: 'html',
192
                        // Code to run if the request succeeds;
193
                        success: function (html) {
194
                            var returnHtml = html.split('[BRK]');
195
                            $('#news_submission_list').html(returnHtml[0]);
196
                            window.OSDMessageDisplay(returnHtml[1]);
197
                            document.getElementById('post').reset();
198
                        }
199
                    });
200
                },
201
                Cancel: function () {
202
                    $(this).dialog('close');
203
                }
204
            }
205
        });
206
    })
207
208
    // ******************
209
    // NEWS EDIT BUTTONS
@@ 142-173 (lines=32) @@
139
        });
140
    })
141
    // Approve Submission Function
142
    $('.jsNewsWrapper').on('click', '.jsNewsApproveButton', function () {
143
        var newsId = $(this).data('news-id');
144
        $('#JSGenericModal').dialog({
145
            title: 'Approve Submission',
146
            open: $('#JSGenericModalText').text('Are you sure you want to approve this submission?'),
147
            resizable: false,
148
            height: 200,
149
            modal: true,
150
            buttons: {
151
                'Approve': function () {
152
                    $(this).dialog('close');
153
                    $.ajaxQueue({
154
                        // The URL for the request
155
                        url: 'db_news.php',
156
                        data: 'action=approve_submission&news_submission_id=' + newsId,
157
                        type: 'POST',
158
                        dataType: 'html',
159
                        // Code to run if the request succeeds;
160
                        success: function (html) {
161
                            var returnHtml = html.split('[BRK]');
162
                            $('#news_submission_list').html(returnHtml[0]);
163
                            window.OSDMessageDisplay(returnHtml[1]);
164
                            document.getElementById('post').reset();
165
                        }
166
                    });
167
                },
168
                Cancel: function () {
169
                    $(this).dialog('close');
170
                }
171
            }
172
        });
173
    })
174
    // Approve submission Function in dropdown
175
    $('.jsNewsWrapper').on('click', '.jsNewsApproveDropdownItem', function () {
176
        var newsId = $(this).data('news-id');